<nz-modal [(nzVisible)]="isVisible" [nzWidth]="modalWidth" (nzOnCancel)="onBack()" [nzStyle]="{'top': '50px'}">
  <div *nzModalTitle>{{ title }}</div>
  <ng-container *nzModalContent>
    <form [formGroup]="facilityMaintenanceRecordForm" (keydown.enter)="$event.preventDefault()">
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="facilityName" nzRequired>公共设施名称</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择公共设施名称'">
              <nz-input-group nzSearch [nzAddOnAfter]="facilityNameSuffixIconButton">
                <input nz-input formControlName="facilityName" placeholder="请选择公共设施名称" readonly />
              </nz-input-group>
              <ng-template #facilityNameSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findFacility()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="maintenanceStartDate">保养开始时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker nzShowTime formControlName="maintenanceStartDate" nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="maintenanceEndDate">保养开始时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker nzShowTime formControlName="maintenanceEndDate" nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="staffName">维修保养人员</nz-form-label>
            <nz-form-control>
              <nz-input-group nzSearch [nzAddOnAfter]="staffNameSuffixIconButton">
                <input nz-input formControlName="staffName" placeholder="请选择维修保养人员" readonly />
              </nz-input-group>
              <ng-template #staffNameSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findStaff()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="remark">备注</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="remark" placeholder="请输入备注" maxlength="255"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
    </form>
  </ng-container>
  <div *nzModalFooter>
    <div class="form-button-container">
      <button nz-button nzType="primary" (click)="onSave()" [nzLoading]="saveLoading">保存</button>
      <button nz-button nzType="default" (click)="onReset()" [nzLoading]="saveLoading">重置</button>
      <button nz-button nzType="default" (click)="onBack()">关闭</button>
    </div>
  </div>
</nz-modal>
<facility-selector (facilitySelectedEvent)="handleFacilitySelectedEvent($event)"></facility-selector>
<staff-selector (staffSelectedEvent)="handleStaffSelectedEvent($event)"></staff-selector>
